<template>
    <div class="login">
    <section class="form_container">
            <div class="manage_tip">
                <span class="title">SuperVip后台管理系统</span>
            </div>
            <el-form :model="loginUser" :rules="rules" ref="loginForm" class="loginForm" label-width="60px">
                <el-form-item label="邮箱" prop="email">
                    <el-input v-model="loginUser.email" placeholder="请输入邮箱"></el-input>
                </el-form-item>
                <el-form-item label="密码" prop="password">
                    <el-input v-model="loginUser.password" placeholder="请输入密码" type="password"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary"  @click="submitForm('loginForm')" class="submit_btn">登  录</el-button>
                </el-form-item>
                <div class="tiparea">
                    <p>还没有账号？现在<router-link to='/register'>注册</router-link></p>
                </div>
            </el-form>
        </section>
    </div>
</template>
<script>
import jwt_decode from 'jwt-decode';
export default {
    name:'login',
     data() {
         var validatePass2=(rule,value,callback)=>{
             if(value===this.registerUser.password){
                 callback();
             }else{
                 callback(new Error('两次输入的密码不一致！'))
             }
         }
      return {
          loginUser:{
              email:'',
              password:''
          },
          rules:{
              email:[
                  {required:true,type:'email',message:'邮箱格式不正确',trigger:'blur'}
              ],
              pas
          }
      }
    },
    methods: {
      onSubmit() {
        console.log('submit!');
      }
    }
  }

</script>